/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx.hotel;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>Project: jse2204 - RoomLog
 * <p>Powered by webrx On 2022-09-23 15:31:32
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class RoomLog implements Comparable<RoomLog>, Serializable {
    @Serial
    private static final long serialVersionUID = 7218546816503695435L;
    private Room room;
    private String msg;

    public RoomLog() {
    }

    public RoomLog(Room room, String msg) {
        this.room = room;
        this.msg = msg;
    }

    public Room getRoom() {
        return room;
    }

    public void setRoom(Room room) {
        this.room = room;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    @Override
    public int compareTo(RoomLog o) {
        return o.getRoom().getEnter().compareTo(this.getRoom().getEnter());
    }

    @Override
    public String toString() {
        return "RoomLog{" +
                "room=" + room +
                ", msg='" + msg + '\'' +
                '}';
    }
}
